import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/Login'
import Index from '@/components/Index'
// 主页
import present from '@/components/present'
// 新增二级子类
import application from '@/components/application'
// 用户反馈
import feedback from '@/components/feedback'
// 发布公告
import announce from '@/components/announce'
// 获取积分
import integral from '@/components/integral'
// 新增二级子类
import User from '@/components/User'
// 新增用户
import management from '@/components/management'
// u用户管理
import user_manage from '@/components/user_manage'
// 测试
import echarts from '@/components/echarts'
// 基本资料 配置管理 角色管理
import baseData from '@/components/baseData'
// vip 积分
import vip from '@/components/vip'
// 修改vip等级
import modify from '@/components/modify'
// 新增vip等级
import addDegree from '@/components/addDegree'
// 修改vip等级
import modifyIntegral from '@/components/modifyIntegral'
// 增加积分等级
import addIntegral from '@/components/addIntegral'
// 办公软件
import office_software from '@/components/office_software'
// 新增软件  更改
import add_software from '@/components/add_software'
// 修改软件
import modify_software from '@/components/modify_software'
// 文章管理
import article from '@/components/article'
// 新增子类   更改
import newSubclass from '@/components/newSubclass'
// mac 最新资讯
import article_information from '@/components/article_information'
// 新增软件
import add_article from '@/components/add_article'
// mac软件 mac游戏
import applica from '@/components/applica'
// 新增插件
import plugInunit from '@/components/plugInunit'
// 新增模板 修改
import add_template from '@/components/add_template'
// 新增壁纸 修改
import add_wallpaper from '@/components/add_wallpaper'
// 新增视频   修改
import add_video from '@/components/add_video'
// 新增素材   修改
import source from '@/components/source'
// 新增图标   修改
import add_icon from '@/components/add_icon'
// 修改密码
import revisePassword from '@/components/revisePassword'
// 设置
import set from '@/components/set'
// 修改用户
import modify_user from '@/components/modify_user'
// 插件主页
import  pluggable_unit from '@/components/pluggable_unit'
// 模板主页
import formwork from '@/components/formwork'
// 壁纸主页
import wallpaper from '@/components/wallpaper'
// 测试
import  ceshi from '@/components/ceshi'
// 视频主页
import  video from '@/components/video'

// 素材主页
import  source_materia from '@/components/source_materia'
// 图标主页
import  icon from '@/components/icon'
// 轮播图表
import  Rotation_chart from '@/components/Rotation_chart'
// 新增轮播
import  add_rotation from '@/components/add_rotation'
// 删除轮播
import  del_rotation from '@/components/del_rotation'
// 选择软件
import  select_software from '@/components/select_software'



Vue.use(Router)
export default new Router({
  routes: [
    {
      path: '/',
      component: Login,
    },
    {path: '/login', component: Login},

    
    {path: '/index', component: Index,redirect:'/present',
  children:[
    {path:'/present',component:present},
    {path:'/application',component:application},
    {path:'/feedback',component:feedback},
    {path:'/announce',component:announce},
    {path:'/integral',component:integral},
    {path:'/user',component:User},
    {path:'/management',component:management},
    {path:'/user_manage',component:user_manage},
    {path:'/echarts',component:echarts},
    {path:'/baseData',component:baseData},
    {path:'/vip',component:vip},
    {path:'/modify',component:modify},
    {path:'/addDegree',component:addDegree},
    {path:'/modifyIntegral',component:modifyIntegral},
    {path:'/addIntegral',component:addIntegral},
    {path:'/office_software',component:office_software},
    {path:'/add_software',component:add_software},
    {path:'/article',component:article},
    {path:'/newSubclass',component:newSubclass},
    {path:'/article_information',component:article_information},
    {path:'/add_article',component:add_article},
    {path:'/applica',component:applica},
    {path:'/plugInunit',component:plugInunit},
    {path:'/add_template',component:add_template},
    {path:'/add_wallpaper',component:add_wallpaper},
    {path:'/add_video',component:add_video},
    {path:'/source',component:source},
    {path:'/add_icon',component:add_icon},
    {path:'/revisePassword',component:revisePassword},
    {path:'/set',component:set},
    {path:'/modify_user',component:modify_user},
    {path:'/modify_software',component:modify_software},
    {path:'/pluggable_unit',component:pluggable_unit},
    {path:'/formwork',component:formwork},
    {path:'/wallpaper',component:wallpaper},
    {path:'/ceshi',component:ceshi},
    {path:'/video',component:video},
    {path:'/source_materia',component:source_materia},
    {path:'/icon',component:icon},
    {path:'/Rotation_chart',component:Rotation_chart},
    {path:'/add_rotation',component:add_rotation},
    {path:'/del_rotation',component:del_rotation},
    {path:'/select_software',component:select_software}

  ]},

  ]
})


const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}